# Maintainer: Lubosz Sarnecki <lubosz@gmail.com>

_realname=pitivi
pkgbase=mingw-w64-${_realname}-git
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
pkgver=0.93.6004.23cd814
pkgrel=1
pkgdesc="Free, intuitive and featureful movie editor for the Linux desktop. (mingw-w64)"
arch=('any')
url="http://pitivi.org/"
license=("LGPL")
makedepends=('automake' 'libtool' 'intltool' 'itstool' 'gtk-doc' 'gnome-doc-utils' 'yelp-tools')
depends=("${MINGW_PACKAGE_PREFIX}-gst-plugins-base"
        "${MINGW_PACKAGE_PREFIX}-gstreamer"
        "${MINGW_PACKAGE_PREFIX}-gobject-introspection"
        "${MINGW_PACKAGE_PREFIX}-python3"
        "${MINGW_PACKAGE_PREFIX}-python3-gobject"
        "${MINGW_PACKAGE_PREFIX}-gst-python-git"
        "${MINGW_PACKAGE_PREFIX}-gst-editing-services"
        "${MINGW_PACKAGE_PREFIX}-python3-numpy")
options=(!libtool strip staticlibs)
#source=(git+https://git.gnome.org/browse/$_realname)
source=(${_realname}::"git+https://github.com/lubosz/$_realname#branch=msys2")
sha256sums=('SKIP')

pkgver() {
  cd $_realname
  version=$(grep AC_INIT configure.ac | sed 's/AC_INIT(Pitivi, //' | sed 's/,//')
  hash=$(git log --pretty=format:'%h' -n 1)
  revision=$(git rev-list --count HEAD)
  echo $version.$revision.$hash
}

build() {
  cd $_realname
  ./autogen.sh \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --disable-static \
    --enable-shared \
    --enable-silent-rules
  make
}

package() {
  cd $_realname
  make -j1 DESTDIR="$pkgdir" install
}
